package zookeeper.rmi.consumer;


import zookeeper.rmi.service.HelloService;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

/**
 * Created by majian8 on 2018/6/12.
 */
public class RmiConsumer {
    public static void main(String[] args) throws RemoteException, NotBoundException, MalformedURLException {
        String url="rmi://localhost:1100/helloService";
        HelloService helloService= (HelloService) Naming.lookup(url);
        System.out.println(helloService.say("zhangshang"));
    }
}
